The dtsrun utility in SQL Server 2000 is no longer used within SQL Server 2008. It has been taken over by the dtexec
utility, which is bigger and better and has more options and values to
serve your every SSIS package execution need. Before you begin to use
the dtexec utility, you should execute it at a command prompt with the help option set only and pipe the results into a text file:
c:> dtexec /? > dtexec.txt
You will quickly see all the main options and how similar this is to dtsrun (in SQL Server 2000). Some dtsrun command-line options have direct dtexec equivalents, such as the options for providing a server name or package name or for setting the value of a variable. Other dtsrun command-line options don’t have direct dtexecdtexec command-line options support features in SSIS, such as the options to pass in connection strings and manage checkpoints. equivalents. In addition, some
You can create new command-line dtexec executions visually with the assistance of the Package Execution utility, which you open through dtexecui. This GUI displays all the available options and ensures the use of the correct syntax (see Figure 1). You start it up from the command prompt:
Using this Package
Execution utility is really the best way to create new command-line
executions for SSIS packages and to run them easily. Figure 2 shows the Package Execution Progress console during a package execution. You can choose to stop the execution from here.
When you double-click any filesystem-stored SSIS package (that is, .dtsx file), you are always placed in this dtexecui environment (just as you automatically start up Microsoft Word when you double-click a Word document).
The dtexec Utility
You use the dtexec command-line utility to configure and execute SSIS packages. The dtexec
utility provides access to all the package configuration and execution
features, such as connections, properties, variables, logging, and
progress indicators. The dtexec utility lets you load packages from three sources:
The dtexec utility proceeds through four phases as it executes:
Command sourcing phase— The command prompt reads the list of options and arguments specified. All subsequent phases are skipped if a /? or /H[ELP] option is encountered.
Package-loading phase— The package specified by the /SQL, /FILE, or /DTS option is loaded.
Configuration phase—
These options are processed in the following order: process options
that set package flags, variables, and properties; process options that
verify the package version and build; and process options that
configure the runtime behavior of the utility, such as reporting.
Validation and execution phase— The package is run or validated without running if the /VALIDATE option was specified.
When a package runs, dtexec can return an exit code. The exit code is used to populate the ERRORLEVEL
variable—the value of which can then be tested in conditional
statements or branching logic within an operating system batch file.
The dtexec utility can set the following exit code values:
Exit Code Value | Description |
---|
0 | Successful package execution. |
1 | Package execution failure. |
3 | User-canceled package execution. |
4 | Package could not be found. |
5 | Package could not be loaded. |
6 | Utility encountered an internal error. |